package org.bird.hystrix;

import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;

/**
 * hystrix样例
 * @author liangjf
 *
 */
public class HelloWorldCommand extends HystrixCommand<String> {

	private final String name;  
	 
	public HelloWorldCommand(String name) {
		//最少配置:指定命令组名(CommandGroup)  
        super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"));  
        this.name = name;  
	}

	protected String run() throws Exception {
		// 依赖逻辑封装在run()方法中  
        return "Hello " + name +" thread:" + Thread.currentThread().getName();  
	}

}
